package com.training.java.redbox.struts.domain;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {
	
	@Autowired
	private OrdersDAO orderDao;

	@Override
	public void createOrders(Orders orders) throws ServiceException {
		try {
			orderDao.createOrders(orders);
		} catch (DAOException e) {
			e.printStackTrace();
			throw new ServiceException(e);
		}
		
		
	}
	@Override
	public long getOrderNumber() throws ServiceException {
		long orderNumber=0;
		try {
			 orderNumber=orderDao.getOrderNumber();
			System.out.println("orderDao.getordernumber= " + orderDao.getOrderNumber());
		} catch (DAOException e) {
			e.printStackTrace();
			throw new ServiceException(e);
		}
		return orderNumber;
	}

	
	

	@Override
	public List<Orders> getAllOrders() throws DAOException {
		return null;
	}

	@Override
	public Orders getOrdersById(long id) throws DAOException {
		return null;
	}

	@Override
	public void update(Orders orders) throws DAOException {
		
	}

	@Override
	public void delete(long id) throws DAOException {
		
	}

	
}
